Skip to content

feat(ai): add external CLI workflows for commits, analysis, and branches - #2900

Open
DJ-Huang wants to merge 1 commit into
sourcegit-org:developfrom
DJ-Huang:codex/sourcegit-ai-workflows
Open

DJ-Huang wants to merge 1 commit into
sourcegit-org:developfrom
DJ-Huang:codex/sourcegit-ai-workflows

Conversation

@DJ-Huang

Copy link
Copy Markdown

Summary

SourceGit can use a configured external AI command alongside its OpenAI-compatible services. Profiles specify an executable, individual arguments, supported tasks, a timeout, and either UTF-8 stdin or a temporary prompt file. Plain stdout is sufficient. An optional JSONL protocol adds collapsible tool and reasoning output and resumable sessions for compatible adapters.

  • Generate and apply a one-line commit subject from the staged changes. The staged-file context menu uses only the selected files, and amend uses the parent commit as its baseline.
  • Open AI → Analysis from a commit, a file selection, or lines in a text diff. Select a profile and click Start analysis. The window keeps the original diff for follow-ups and supports Markdown, code blocks, and copying across blocks.
  • Review a generated branch name and choose Create branch and commit. SourceGit rechecks the staged snapshot and uses its normal commit path. If a commit hook rejects the commit, the new branch and staged changes are available for retry.

Screenshots

Captured from SourceGit in English using a local test repository and fixture CLI.

Commit subject and editable branch suggestion

CLI commit assistant showing a generated subject, an editable branch name, and Create branch and commit

Analysis with Markdown, a code example, and a follow-up

Analysis conversation with collapsible trace rows, a Markdown result, code, and a right-aligned follow-up

CLI selection before running analysis

The analysis window waits for the user to select a CLI and click Start analysis

Verification

  • Windows .NET 10 build and dotnet format --verify-no-changes.
  • Temporary repositories for staged-file selection, amend, commit and line-level analysis, Markdown range copy, CLI selection, and snapshot reuse on follow-up.
  • Plain stdout and JSONL fixtures for cancellation, timeout, and session expiry. A temporary pre-commit hook verified that a failed commit preserves the new branch and staged changes.

Refs #2855.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant